package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/1
 */
/**
 * 总经理审批者（审批≤20万元）
 */
public class GeneralManager extends Approver {
    public GeneralManager(String name) {
        super(name);
    }

    @Override
    public void handleRequest(PurchaseRequest request) {
        if (request.getAmount() <= 200000) {
            System.out.printf("总经理[%s]审批采购单[%s]，金额：%.2f元（符合≤20万标准）\n",
                    name, request.getRequestName(), request.getAmount());
        } else {
            if (successor != null) {
                System.out.printf("总经理[%s]无权限审批%.2f元采购单，需会议审批...\n",
                        name, request.getAmount());
                successor.handleRequest(request);
            } else {
                System.out.println("错误：未配置最终审批者！");
            }
        }
    }
}